package calao.plan.client;

import com.google.gwt.user.client.rpc.IsSerializable;

public class WorkPeriod 
implements IsSerializable
{

	int weekDay;
	
	int startHour;
	
	int startMin;
	
	int endHour;
	
	int endMin;
	
	public WorkPeriod() { }
	
	public WorkPeriod(int weekDay, int startHour, int startMin, int endHour, int endMin)
	{
		this.weekDay = weekDay;
		this.startHour = startHour;
		this.startMin = startMin;
		this.endMin = endMin;
		this.endHour = endHour;
	}
	
	public WorkPeriod(WorkPeriod period)
	{
		weekDay = period.weekDay;
		startHour = period.startHour;
		startMin = period.startMin;
		endHour = period.endHour;
		endMin= period.endMin;
	}

	public int getEndHour() {
		return endHour;
	}

	public void setEndHour(int endHour) {
		this.endHour = endHour;
	}

	public int getEndMin() {
		return endMin;
	}

	public void setEndMin(int endMin) {
		this.endMin = endMin;
	}

	public int getStartHour() {
		return startHour;
	}

	public void setStartHour(int startHour) {
		this.startHour = startHour;
	}

	public int getStartMin() {
		return startMin;
	}

	public void setStartMin(int startMin) {
		this.startMin = startMin;
	}

	public int getWeekDay() {
		return weekDay;
	}

	public void setWeekDay(int weekDay) {
		this.weekDay = weekDay;
	}
	
	// TODO make sure this is checked before further use
	
	public boolean isValid()
	{
		return startHour<endHour || startMin<endMin;
	}
	
	
}
